<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Table</title>
    <link rel="stylesheet" href="../plugins/elementui/index.css">
    <script src="../js/vue.js"></script>
    <script src="../plugins/elementui/index.js"></script>
</head>
<body>
<div id="app">
    <el-table :data="tableData" border style="width: 100%">
        <el-table-column prop="date" label="日期" width="180">
        </el-table-column>
        <el-table-column prop="name" label="姓名" width="180">
        </el-table-column>
        <el-table-column prop="address" label="地址">
        </el-table-column>
    </el-table>

<!--  size-change： 页面大小变化时触发，调用handleSizeChange
      current-change： 页码变更时触发，调用handleCurrentChange
      current-page：当前页码 currentPage4在data中声明
      page-sizes: 页面大小下拉选择框的内容
      page-size: 当前页面大小，每页显示多少条记录
      layout: 分页工具栏的布局（显示哪些）
      total： 总记录数
-->
    <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="currentPage4"
            :page-size="pageSize"
            layout="total, prev, pager, next, jumper"
            :total="200">
    </el-pagination>
</div>
<script>
    var vue = new Vue({
        el: '#app',
        data() {
            return {
                tableData: [{
                    date: '2016-05-02',
                    name: '王小虎',
                    address: '上海市普陀区金沙江路 1518 弄'
                }, {
                    date: '2016-05-04',
                    name: '王小虎',
                    address: '上海市普陀区金沙江路 1517 弄'
                }, {
                    date: '2016-05-01',
                    name: '王小虎',
                    address: '上海市普陀区金沙江路 1519 弄'
                }, {
                    date: '2016-05-03',
                    name: '王小虎',
                    address: '上海市普陀区金沙江路 1516 弄'
                }],
                currentPage4: 4,
                pageSize: 10
            }
        },
        created() {
        },
        mounted() {
        },
        methods: {
            // 定义方法的地方
            handleSizeChange(val) {
                console.log(`每页 ${val} 条`);
            },
            handleCurrentChange(val) {
                console.log(`当前页: ${val}`);
            }
        }
    });
</script>
</body>
</html>